package com.vipheyue.fastlib.utils;

import java.io.File;

/**
 * Created by heyue on 16/9/20.
 */

public class FileUtil {
    public File createFile(String dirName, String imageName) {
        File dir = new File(dirName);
        if (!dir.exists()) {
            dir.mkdir();
        }
        return new File(dir, imageName);
    }

    public String getFileName(String pUrl) {
        int separatorIndex = pUrl.lastIndexOf("/");
        String path = (separatorIndex < 0) ? pUrl : pUrl.substring(separatorIndex + 1, pUrl.length());
        return path;
    }
}
